<?php   

include '../Classes/userHandler.php';
include '../Classes/db.php';
		
$x=new DbConnect();
$con=$x->getConnection();

$id=$_GET['id'];
$level=$_GET['level'];
$empno=$_GET['empno'];
$status=$_GET['status'];
$len=strlen($empno);

if($len=="4"){
	if(!($level=="Parent"))
	{
		$user=new UserHandler();
		$user->setConnect($con);
		$users=$user->userUpdate($id,$empno,$level,$status);
 		echo $users;
	}
	else
	{
		echo"Invalid Privileges for Employee"; 
	}
}
elseif($len=="5")
	{
		if(!($level=="User"||$level=="Admin"))
		{
		$user=new UserHandler();
		$user->setConnect($con);
		$users=$user->userUpdate($id,$empno,$level,$status);
		echo $users;
		}
		else
		{
    		echo"Invalid Privileges for Student"; 
		}
	} 
else
	{
	echo "Invalid Input No";
	}
?>



